﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace SkeletonNET.Logging
{
    public abstract class LogHandler
    {
        /// <summary>
        /// Gets or sets the type of the caller.
        /// </summary>
        /// <value>
        /// The type of the caller.
        /// </value>
        public Type CallerType { get; set; }

        /// <summary>
        /// Log an exception
        /// </summary>
        /// <param name="exception">The exception to log.</param>
        /// <param name="data">The data to log.</param>
        public virtual void Exception(Exception exception, LogData data = null)
        {
            InternalException(exception, data);
        }
        /// <summary>
        /// Log something
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="data">The data.</param>
        public virtual void Do(string message, LogData data = null)
        {
            InternalDo(message, data);
        }
        /// <summary>
        /// The actual implementation of logging an exception.
        /// </summary>
        /// <param name="exception">The exception.</param>
        /// <param name="data">The data.</param>
        protected abstract void InternalException(Exception exception, LogData data = null);
        /// <summary>
        /// The actual implementation of the Do method.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="data">The data.</param>
        protected abstract void InternalDo(string message, LogData data = null);
    }
}
